package cn.rkylin.oms.warehouse.stock.dao;

import cn.rkylin.oms.warehouse.stock.domain.BatchStockLog;
import cn.rkylin.oms.warehouse.stock.domain.Stock;
import cn.rkylin.oms.warehouse.stock.domain.StockLog;
import cn.rkylin.oms.warehouse.stock.vo.BatchStockVO;
import cn.rkylin.oms.warehouse.stock.vo.StockVO;
import com.github.pagehelper.PageInfo;

import java.util.List;

/**
 * 库存DAO接口
 *
 * @author liming
 * @date 2017/10/16
 */
public interface IStockDAO {
    /**
     * 获取单个sku库存信息
     *
     * @param stockVO
     * @return
     * @throws Exception
     */
    public StockVO getStock(StockVO stockVO) throws Exception;

    public List<StockVO> getSkuList(StockVO stockVO) throws Exception;

    /**
     * 更新Sku库存
     *
     * @param stock
     * @return
     * @throws Exception
     */
    public int updateStock(Stock stock) throws Exception;

    /**
     * 更新Sku库存
     *
     * @param stock
     * @return
     * @throws Exception
     */
    public int updateStock2(Stock stock) throws Exception;

    /**
     * 插入库存
     *
     * @param stock
     * @return
     * @throws Exception
     */
    public int insertStock(Stock stock) throws Exception;

    /**
     * 插入库存日志
     *
     * @param stockLog
     * @return
     * @throws Exception
     */
    public int insertStockLog(StockLog stockLog) throws Exception;

    /**
     * 获取未分派数
     *
     * @param stockVO
     * @return
     * @throws Exception
     */
    public StockVO getUnallotQty(StockVO stockVO) throws Exception;

    /**
     * selectPagedByCondition：根据查询条件获取库存信息列表
     *
     * @param page
     * @param length
     * @param queryParamVO
     * @return
     * @throws Exception
     */
    public PageInfo<StockVO> selectPagedByCondition(int page, int length, StockVO queryParamVO) throws Exception;

    public StockVO selectSkuStockBySkuId(StockVO stockVO) throws Exception;

    /**
     * 获取批次库存信息
     *
     * @param batchStockVO
     * @return
     * @throws Exception
     */
    public BatchStockVO getBatchStock(BatchStockVO batchStockVO) throws Exception;

    /**
     * 插入批次库存
     *
     * @param batchStockVO
     * @return
     * @throws Exception
     */
    public int insertBatchStock(BatchStockVO batchStockVO) throws Exception;

    /**
     * 更新批次库存（增量）
     *
     * @param batchStockVO
     * @return
     * @throws Exception
     */
    public int updateBatchStock(BatchStockVO batchStockVO) throws Exception;

    /**
     * 插入批次库存日志
     *
     * @param batchStockLog
     * @return
     * @throws Exception
     */
    public int insertBatchStockLog(BatchStockLog batchStockLog) throws Exception;
}
